<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="${ctx}/scripts/jquery-1.4.2.min.js"></script> 
<script type="text/javascript" src="${ctx}/scripts/jquery.pagination.js"></script> 
<title>专题</title> 
<link href="${ctx}/css/index.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/css/gr.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/css/hb.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
   $(document).ready(function() {
       if('${param.catId}'!=''){ 
	       getPage(1)
		}	
   });
    function getPage(pageNumber){ 
        var pageSize= document.getElementById('pageSize').value;
     	$.get("${ctx}/news/News/listAjax.do", {
	           Action:"get",pageNumber:pageNumber,pageSize:pageSize,catId:"${param.catId}"}, function (data, textStatus){	 
	           var content='';
	           if(data!=""){
	              data = data.replace(new RegExp("null","gm"),'""');
	           	  var mydata = eval("("+data+")");
	           	  if(mydata.rows!=undefined){
	           	    var ojbs=mydata.rows;  
	           	     for(var i=0;i<ojbs.length;i++){ 		
					    var temp=ojbs[i]; 
					    content+=' <li style="width:116px;float:left;margin-left:10px;margin-right:10px;height:216px;"><a href="${ctx}'+temp.fromUrl+'" target="_blank"><p class="zhanshi_tu"><img src="${ctx}'+temp.fromUrl+'"  height="135" width="116"/></p><span>'+temp.title+'</span></a></li>';
        	         }
                      
                      document.getElementById('list').innerHTML = content;
			          var total=mydata.total;
			          var len=1;
			          if(total>pageSize){
			             len=parseInt(total/pageSize)+1;
			          }
			          
			          var page="";
			          if(pageNumber>1){
			          	page+='<a href="javascrīpt:void(0);" onclick="getPage('+(pageNumber-1)+');return false"> 上一页</a>';
			          }else{
			          	page+='<a href="javascrīpt:void(0);" onclick="getPage(1);return false"> 上一页</a>';
			         
			          }
			          for(var j=1;j<=len;j++){
			             if(j==pageNumber){
			               page+='<a href="javascrīpt:void(0);" class="list_fenye_select" >'+j+'</a>';
			             }else{
			               page+='<a href="javascrīpt:void(0);"  onclick="getPage('+j+');return false" >'+j+'</a>';
			             }
			          }
			          if(pageNumber<len){
			          	page+='<a href="javascrīpt:void(0);" onclick="getPage('+(pageNumber+1)+');return false">下一页 </a>';
			          }else{
			          	page+='<a href="javascrīpt:void(0);" onclick="getPage('+len+');return false"> 下一页 </a>';
			         
			          } 
			          document.getElementById('list_fenye').innerHTML = page;
   					  
   					   document.getElementById('titles').innerHTML = mydata.titles;
	           	  }
		            
	           }
	       });	
     }
</script>
</head>
<body>
<input type="hidden" id="pageNumber" name="pageNumber" value="1"/>
<input type="hidden" id="pageSize" name="pageSize" value="30" />
<div class="box">
	<div class="hb_top"><a href="http://10.78.109.32/index.jsp"><img src="${ctx}/images/web/first_ico.jpg" />返回首页</a><a href="javascript: SetHome()"><img src="${ctx}/images/web/tianjia_sc.jpg" />设为主页</a><a href="javascript: AddFavorite(window.location,document.title)"><img src="${ctx}/images/web/lx_my.jpg" />收藏本站</a></div>
    <div><img src="${ctx}/images/chanpin/d_top.jpg" /></div>
    
   <div><a href="#"><img src="${ctx}/images/chanpin/d_center.jpg" /></a></div> 
    <div style="margin-top:2px;"><img src="${ctx}/images/chanpin/d_b.jpg" /></div>
    </div>
    <br/> 
   
     <div class="cp_contentd">
        <div class="cp_zhanshi">
            <div class="cp_zhanshi_title">
                <span id="titles"> </span>
                <div class="cp_title_xian2"></div> 
               <div class="clear"></div>
            </div>
            <ul id="list"> 
            	 
 			</ul>
         </div> 
         
         <div class="clear"></div>
            <div class="list_fenye" id="list_fenye"> 
   	     </div> 
         
     </div>
     
    <div class="clear"></div>	  
    <div class="footerd"><ul>Copyright ©2011-2012 北京车辆段 版权所有</ul>
							信息技术科 联系电话：010-51868237</div> 
</body>
</html>
